package com.wangnian.wangcai.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Config {
    // 自动T
    public static String autoT = "autoT";
    public static String maxT = "maxT";

    // 每天定投
    public static String autoDT = "autoDT";

    public static String maxDT = "maxDT";

    // 每天买的code
    public static String code = "code";
    //回本通知
    public static List<String> dayStr = new ArrayList<>();


    public static boolean refreshChiGu = false;
    public static boolean refreshBalance = false;

    //定投
    public static int type1 = 1;
    //做T
    public static int type2 = 2;

    public static void allowRefresh() {
        Config.refreshBalance = true;
        Config.refreshChiGu = true;
    }

    /**
     * 本地缓存
     */
    public static Map<String, Integer> configMap = new HashMap<String, Integer>() {
        {
            put(autoT, 1);
            put(maxT, 10000);
            put(autoDT, 1);
            put(maxDT, 100000);
            put(code, 513050);
        }
    };

    public static void setConfig(String name, Integer value) {
        configMap.put(name, value);
    }

    public static Integer get(String name) {
        return configMap.get(name);
    }

}
